<!DOCTYPE html>
<html  lang="en">
<head>
    <meta charset="utf-8" />

<meta name="generator" content="Hexo 4.2.0" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<title>关于队列、堆栈、树的数据结构总结 - YEAR9&#39;s Blog | Archive of development experience</title>


    <meta name="description" content="最近手头终于把事情忙好，然后来处理一下博客，毕竟都断更了这么久了。不吹不黑，最近啥事都没干，主要还是在学校留的作业和网课上忙里忙外，以及还有项目的开发中，隔壁博客的菜猴最近高产，都在研究数据结构算法，其实这快我不拿手，借助博客，把在做PTA时候复制粘贴过的博客做个总结，嗯！ 是这样的。菜猴牛逼！ 队列队列和栈一样，在实际程序的算法设计和计算机一些其他分支里，都有很多重要的应用，比如计算机操作系统对">
<meta property="og:type" content="article">
<meta property="og:title" content="关于队列、堆栈、树的数据结构总结">
<meta property="og:url" content="https://blog.year9.cn/posts/31880.html">
<meta property="og:site_name" content="YEAR9&#39;s Blog | Archive of development experience">
<meta property="og:description" content="最近手头终于把事情忙好，然后来处理一下博客，毕竟都断更了这么久了。不吹不黑，最近啥事都没干，主要还是在学校留的作业和网课上忙里忙外，以及还有项目的开发中，隔壁博客的菜猴最近高产，都在研究数据结构算法，其实这快我不拿手，借助博客，把在做PTA时候复制粘贴过的博客做个总结，嗯！ 是这样的。菜猴牛逼！ 队列队列和栈一样，在实际程序的算法设计和计算机一些其他分支里，都有很多重要的应用，比如计算机操作系统对">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://blog.year9.cn/images/og_image.png">
<meta property="article:published_time" content="2020-04-26T09:58:00.000Z">
<meta property="article:modified_time" content="2020-04-26T12:00:29.266Z">
<meta property="article:author" content="YEAR9">
<meta property="article:tag" content="树">
<meta property="article:tag" content="哈夫曼树">
<meta property="article:tag" content="栈">
<meta property="article:tag" content="队列">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog.year9.cn/images/og_image.png">





<link rel="alternative" href="/atom.xml" title="关于队列、堆栈、树的数据结构总结" type="application/atom+xml">



<link rel="icon" href="/images/favicon.svg">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-light.css">


    
    
<style>body>.footer,body>.navbar,body>.section{opacity:0}</style>

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">

    
    
    
    
<link rel="stylesheet" href="/css/back-to-top.css">

    
    
    
    
    
    
    
    <link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
    
    
    


<link rel="stylesheet" href="/css/style.css">
    <meta name="baidu-site-verification" content="uZwQxsLLR3" />
<!--         <style> 
        html { 
            -webkit-filter: grayscale(100%); 
            -moz-filter: grayscale(100%); 
            -ms-filter: grayscale(100%); 
            -o-filter: grayscale(100%); 
            filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);  
            _filter:none; 
        } 
    </style>  -->
</head>
<body class="is-3-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                <img src="/images/logo.png" alt="关于队列、堆栈、树的数据结构总结" height="28">
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item"
                href="/">Home</a>
                
                <a class="navbar-item"
                href="/archives">Archives</a>
                
                <a class="navbar-item"
                href="/categories">Categories</a>
                
                <a class="navbar-item"
                href="/tags">Tags</a>
                
                <a class="navbar-item"
                href="/posts/27225.html">About</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="Download on GitHub" href="https://gitee.com/year9">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                    
                
                
                
                <a class="navbar-item search" title="Search" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main">
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2020-04-26T09:58:00.000Z">2020-04-26</time>
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    21 minutes read (About 3153 words)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                关于队列、堆栈、树的数据结构总结
            
        </h1>
        <div class="content">
            <p>最近手头终于把事情忙好，然后来处理一下博客，毕竟都断更了这么久了。<br>不吹不黑，最近啥事都没干，主要还是在学校留的作业和网课上忙里忙外，以及还有项目的开发中，隔壁博客的菜猴最近高产，都在研究数据结构算法，其实这快我不拿手，借助博客，把在做PTA时候复制粘贴过的博客做个总结，嗯！ 是这样的。菜猴牛逼！</p>
<h1 id="队列"><a href="#队列" class="headerlink" title="队列"></a>队列</h1><p>队列和栈一样，在实际程序的算法设计和计算机一些其他分支里，都有很多重要的应用，比如计算机操作系统对进程 or 作业的优先级调度算法，对离散事件的模拟算法，还有计算机主机和外部设备运行速度不匹配的问题解决等，很多很多。其实队列的本质还是线性表！只不过是一种特殊的或者说是受限的线性表，是这样的：</p>
<p><img src="/images/pasted-14.png" alt="upload successful"></p>
<a id="more"></a>

<p>1）、限定在表的一端插入、另一端删除。 插入的那头就是队尾，删除的那头就是队头。也就是说只能在线性表的表头删除元素，在表尾插入元素。形象的说就是水龙头和水管，流水的水嘴是队头，进水的泵是队尾，管子中间不漏水不进水。这样呲呲的流动起来，想想就是这么个过程。</p>
<p>2)、先进先出 (FIFO结构)。显然我们不能在表（队列）的中间操作元素，只能是在尾部进，在头部出去，还可以类似火车进隧道的过程。（first in first out = FIFO 结构）</p>
<p><img src="/images/pasted-16.png" alt="upload successful"></p>
<p><strong>解决队列的假溢出，优化算法得到循环队列</strong></p>
<p><img src="/images/pasted-17.png" alt="upload successful"></p>
<p>如上图所示，队列的大小为size = 11，队列head指向 5 ，队尾fail指向10，当向队尾添加一个元素F，这时fail = 0，这时再向队尾添加一个元素G，这时fail = 1.队列就变为下图所示</p>
<p><img src="/images/pasted-18.png" alt="upload successful"></p>
<p>循环队列的难点在于如何确定队空和队满的判定条件以及head和fail的变化.</p>
<p>fail的变化，当fail=10，如何让fail = 0呢？很显然 fail = (fail+1)%size; 那么head同理也遵循这样的变化head=(head+1)%size.</p>
<p>如何判定队满呢？从上面的规律来看，我们可以发现(fail+1)%size == head的时候，队列就满了，但是fail指向的位置实际上是没有数据的，这就意味这循环队列浪费了一个存储空间，以空间换取时间。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">bool AddQ( Queue Q, ElementType X ); &#x2F;&#x2F;定义入队</span><br><span class="line">ElementType DeleteQ( Queue Q ); &#x2F;&#x2F;定义出队</span><br><span class="line"></span><br><span class="line">typedef int Position;</span><br><span class="line">typedef struct QNode *PtrToQNode;</span><br><span class="line">struct QNode &#123;</span><br><span class="line">    ElementType *Data;  &#x2F;* 存储元素的数组   *&#x2F;</span><br><span class="line">    Position Front;     &#x2F;* 队列的头指针     *&#x2F;</span><br><span class="line">    int Count;          &#x2F;* 队列中元素个数   *&#x2F;</span><br><span class="line">    int MaxSize;        &#x2F;* 队列最大容量     *&#x2F;</span><br><span class="line">&#125;;</span><br><span class="line">typedef PtrToQNode Queue; </span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;入队</span><br><span class="line">bool AddQ( Queue Q, ElementType X )</span><br><span class="line">&#123;</span><br><span class="line">    if (Q-&gt;Count &#x3D;&#x3D; Q-&gt;MaxSize) &#123; &#x2F;&#x2F;先得判断一下队列满没满，因为有count字段，直接判断就可以，Count统计好队列里的个数</span><br><span class="line">        printf(&quot;Queue Full\n&quot;);</span><br><span class="line">        return false;</span><br><span class="line">    &#125;</span><br><span class="line">    Q-&gt;Count++; &#x2F;&#x2F;如果有入队就改变</span><br><span class="line">    Q-&gt;Data[(Q-&gt;Count+Q-&gt;Front)%Q-&gt;MaxSize] &#x3D; X; </span><br><span class="line">     &#x2F;&#x2F;(Q-&gt;Count+Q-&gt;Front)%Q-&gt;MaxSize 队内个数+头的位置 和队列最大长度 &#x3D; 当前入队位置</span><br><span class="line">    return false;</span><br><span class="line">&#125;</span><br><span class="line">&#x2F;&#x2F;出队</span><br><span class="line">ElementType DeleteQ( Queue Q )</span><br><span class="line">&#123;</span><br><span class="line">    if(Q-&gt;Count &#x3D;&#x3D; 0)</span><br><span class="line">    &#123;</span><br><span class="line">        printf(&quot;Queue Empty\n&quot;); &#x2F;&#x2F;判断队空</span><br><span class="line">        return ERROR;</span><br><span class="line">    &#125;</span><br><span class="line">    Q-&gt;Count--;</span><br><span class="line">    Q-&gt;Front&#x3D;(Q-&gt;Front+1)%Q-&gt;MaxSize; &#x2F;&#x2F; 找到当前的出队位置</span><br><span class="line">    return Q-&gt;Data[Q-&gt;Front];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h1 id="堆栈"><a href="#堆栈" class="headerlink" title="堆栈"></a>堆栈</h1><p>首先在数据结构上要知道堆栈，尽管我们这么称呼它，但实际上堆栈是两种数据结构：堆和栈。 堆和栈都是一种数据项按序排列的数据结构。<br>栈就像装数据的桶或箱子</p>
<p>我们先从大家比较熟悉的栈说起吧，它是一种具有后进先出性质的数据结构，也就是说后存放的先取，先存放的后取。这就如同我们要取出放在箱子里面底下的东西（放入的比较早的物体），我们首先要移开压在它上面的物体（放入的比较晚的物体）。<br>堆像一棵倒过来的树</p>
<p>而堆就不同了，堆是一种经过排序的树形数据结构，每个结点都有一个值。通常我们所说的堆的数据结构，是指二叉堆。堆的特点是根结点的值最小（或最大），且根结点的两个子树也是一个堆。由于堆的这个特性，常用来实现优先队列，堆的存取是随意，这就如同我们在图书馆的书架上取书，虽然书的摆放是有顺序的，但是我们想取任意一本时不必像栈一样，先取出前面所有的书，书架这种机制不同于箱子，我们可以直接取出我们想要的书。</p>
<p><img src="/images/pasted-19.png" alt="upload successful"></p>
<p><img src="/images/pasted-20.png" alt="upload successful"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">typedef int Position;</span><br><span class="line">typedef struct SNode *PtrToSNode;</span><br><span class="line">struct SNode &#123;</span><br><span class="line">    ElementType *Data;  &#x2F;* 存储元素的数组 *&#x2F;</span><br><span class="line">    Position Top;       &#x2F;* 栈顶指针       *&#x2F;</span><br><span class="line">    int MaxSize;        &#x2F;* 堆栈最大容量   *&#x2F;</span><br><span class="line">&#125;;</span><br><span class="line">typedef PtrToSNode Stack;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;入栈</span><br><span class="line">bool Push( Stack S, ElementType X )</span><br><span class="line">&#123;</span><br><span class="line">    if (S-&gt;Top &#x3D;&#x3D; S-&gt;MaxSize) &#123; &#x2F;&#x2F;判断栈满</span><br><span class="line">        printf(&quot;Stack Full\n&quot;);</span><br><span class="line">        return false;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    S-&gt;Data[S-&gt;Top] &#x3D; X; </span><br><span class="line">    S-&gt;Top++;</span><br><span class="line">    return true;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;出栈</span><br><span class="line">ElementType Pop( Stack S )</span><br><span class="line">&#123;</span><br><span class="line">    if (S-&gt;Top &#x3D;&#x3D; 0)</span><br><span class="line">    &#123;</span><br><span class="line">        printf(&quot;Stack Empty\n&quot;);</span><br><span class="line">        return ERROR;</span><br><span class="line">    &#125;</span><br><span class="line">    S-&gt;Top--;</span><br><span class="line">    return S-&gt;Data[S-&gt;Top];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>栈的运用 实现括号匹配</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;string.h&gt;</span><br><span class="line">const int MAXN&#x3D;1024;</span><br><span class="line">const int inf&#x3D;1e9;</span><br><span class="line">int n,m;</span><br><span class="line">int top,flag;</span><br><span class="line">char CheckSpace[MAXN];</span><br><span class="line">char inputStringArr[MAXN*10];</span><br><span class="line">char Stack[MAXN];</span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">    int cnt&#x3D;0;</span><br><span class="line">    while(gets(inputStringArr)&amp;&amp;inputStringArr[0]!&#x3D;&#39;.&#39;)</span><br><span class="line">    &#123;</span><br><span class="line">        long l &#x3D; strlen(inputStringArr);</span><br><span class="line">        for(int i&#x3D;0; i&lt;l; ++i)</span><br><span class="line">        &#123;   if(inputStringArr[i]&#x3D;&#x3D;&#39;(&#39;||inputStringArr[i]&#x3D;&#x3D;&#39;)&#39;||inputStringArr[i]&#x3D;&#x3D;&#39;&#123;&#39;||inputStringArr[i]&#x3D;&#x3D;&#39;&#125;&#39;||inputStringArr[i]&#x3D;&#x3D;&#39;[&#39;||inputStringArr[i]&#x3D;&#x3D;&#39;]&#39;)  &#x2F;&#x2F;将整个字符串的符号重新编组</span><br><span class="line">            &#123;</span><br><span class="line">                CheckSpace[cnt++]&#x3D;inputStringArr[i];</span><br><span class="line">            &#125;</span><br><span class="line">            else if(inputStringArr[i]&#x3D;&#x3D;&#39;&#x2F;&#39;&amp;&amp;inputStringArr[i+1]&#x3D;&#x3D;&#39;*&#39;)</span><br><span class="line">            &#123;</span><br><span class="line">                CheckSpace[cnt++]&#x3D;&#39;a&#39;;</span><br><span class="line">                i++;</span><br><span class="line">            &#125;</span><br><span class="line">            else if(inputStringArr[i]&#x3D;&#x3D;&#39;*&#39;&amp;&amp;inputStringArr[i+1]&#x3D;&#x3D;&#39;&#x2F;&#39;)</span><br><span class="line">            &#123;</span><br><span class="line">                CheckSpace[cnt++]&#x3D;&#39;b&#39;;</span><br><span class="line">                i++;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    top&#x3D;0;</span><br><span class="line">    flag&#x3D;1;</span><br><span class="line">    int i;</span><br><span class="line">    for(i&#x3D;0; i&lt;cnt; ++i) &#x2F;&#x2F;重新判断符号，并且入栈匹配</span><br><span class="line">    &#123;</span><br><span class="line">        if(CheckSpace[i]&#x3D;&#x3D;&#39;(&#39;||CheckSpace[i]&#x3D;&#x3D;&#39;[&#39;||CheckSpace[i]&#x3D;&#x3D;&#39;&#123;&#39;||CheckSpace[i]&#x3D;&#x3D;&#39;a&#39;)</span><br><span class="line">        &#123;</span><br><span class="line">            Stack[top++]&#x3D;CheckSpace[i]; &#x2F;&#x2F;入栈</span><br><span class="line">        &#125;</span><br><span class="line">        else if(!top) &#x2F;&#x2F;不匹配也就是直接出现了右括号</span><br><span class="line">        &#123;</span><br><span class="line">            puts(&quot;NO&quot;);</span><br><span class="line">            printf(&quot;?-&quot;);</span><br><span class="line">            if(CheckSpace[i]&#x3D;&#x3D;&#39;b&#39;)printf(&quot;*&#x2F;\n&quot;);</span><br><span class="line">            else printf(&quot;%c\n&quot;,CheckSpace[i]);</span><br><span class="line">            flag&#x3D;0;</span><br><span class="line">            break;</span><br><span class="line">        &#125;</span><br><span class="line">        else if(CheckSpace[i]-Stack[top-1]!&#x3D;1 &amp;&amp; CheckSpace[i]-Stack[top-1]!&#x3D;2) &#x2F;&#x2F;缺少右括号</span><br><span class="line">        &#123;</span><br><span class="line">            puts(&quot;NO&quot;);</span><br><span class="line">            if(Stack[top-1]&#x3D;&#x3D;&#39;a&#39;)printf(&quot;&#x2F;*&quot;);</span><br><span class="line">            else printf(&quot;%c&quot;,Stack[top-1]);</span><br><span class="line">            printf(&quot;-?\n&quot;);</span><br><span class="line">            flag&#x3D;0;</span><br><span class="line">            break;</span><br><span class="line">        &#125;</span><br><span class="line">        else top--;</span><br><span class="line">    &#125;</span><br><span class="line">    if(flag) &#x2F;&#x2F;如果上面的检测都没有检测到</span><br><span class="line">    &#123;</span><br><span class="line">        if(!top)puts(&quot;YES&quot;); &#x2F;&#x2F;栈空直接OK</span><br><span class="line">        else</span><br><span class="line">        &#123; &#x2F;&#x2F;栈里还有元素，那定是缺了右括号</span><br><span class="line">            puts(&quot;NO&quot;);</span><br><span class="line">            if(Stack[0]&#x3D;&#x3D;&#39;a&#39;)printf(&quot;&#x2F;*&quot;);</span><br><span class="line">            else printf(&quot;%c&quot;,Stack[0]);</span><br><span class="line">            printf(&quot;-?\n&quot;);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h1 id="树"><a href="#树" class="headerlink" title="树"></a>树</h1><p> 树形结构是节点之间以及分支关系定义的层次结构。作为一种重要的非线性结构，树形结构中一个节点最多只有一个前驱节点，但是可以有多个后继节点。</p>
<p><img src="/images/pasted-21.png" alt="upload successful"></p>
<p><img src="/images/pasted-22.png" alt="upload successful"></p>
<p><img src="/images/pasted-23.png" alt="upload successful"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br></pre></td><td class="code"><pre><span class="line">typedef struct TNode *Position;</span><br><span class="line">typedef Position BinTree;</span><br><span class="line">struct TNode&#123;</span><br><span class="line">    ElementType Data;</span><br><span class="line">    BinTree Left;</span><br><span class="line">    BinTree Right;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F; 中序遍历</span><br><span class="line">void InorderTraversal( BinTree BT )</span><br><span class="line">&#123;</span><br><span class="line">    if(BT)</span><br><span class="line">    &#123;</span><br><span class="line">        InorderTraversal(BT-&gt;Left);</span><br><span class="line">        printf(&quot; %c&quot;,BT-&gt;Data);</span><br><span class="line">        InorderTraversal(BT-&gt;Right);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">&#x2F;&#x2F;前序</span><br><span class="line">void PreorderTraversal( BinTree BT )</span><br><span class="line">&#123;</span><br><span class="line">    if(BT)</span><br><span class="line">    &#123;</span><br><span class="line">        printf(&quot; %c&quot;,BT-&gt;Data);</span><br><span class="line">        PreorderTraversal(BT-&gt;Left);</span><br><span class="line">        PreorderTraversal(BT-&gt;Right);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;后序</span><br><span class="line">void PostorderTraversal( BinTree BT )</span><br><span class="line">&#123;</span><br><span class="line">    if(BT)</span><br><span class="line">    &#123;</span><br><span class="line">        PostorderTraversal(BT-&gt;Left);</span><br><span class="line">        PostorderTraversal(BT-&gt;Right);</span><br><span class="line">        printf(&quot; %c&quot;,BT-&gt;Data);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;中层遍历 使用队列</span><br><span class="line">由层次遍历的定义可以推知，在进行层次遍历时，对一层结点访问完后再按照它们的访问次序对各个结点的左孩子和右孩子顺序访问，这样一层一层地进行，先遇到的结点先访问,这与队列的操作原则比较吻合。因此，在进行层次遍历时可设置一个队列结构,遍历从二叉树的根结点开始，首先将根结点指针入队列，然后从队头取出一个元素,每取一个元素执行下面两个操作:</span><br><span class="line"></span><br><span class="line">(1)访问该元素所指的结点;</span><br><span class="line">(2)若该元素所指结点的左、右孩子指针非空，则将该元素所指结点的非空左孩子指针和右孩子指针顺序入队。</span><br><span class="line"></span><br><span class="line">若队列非空,重复以上过程,当队列为空时,二叉树的层次遍历结束。</span><br><span class="line">void LevelorderTraversal( BinTree BT )</span><br><span class="line">&#123;</span><br><span class="line">    int  i&#x3D;0,j&#x3D;0;</span><br><span class="line">    BinTree ptr[100]&#x3D;&#123;NULL&#125;,ptr1&#x3D;NULL;</span><br><span class="line">    if(BT!&#x3D;NULL)</span><br><span class="line">    &#123;</span><br><span class="line">        ptr[i++]&#x3D;BT; &#x2F;&#x2F;节点入队</span><br><span class="line">        while(i&gt;j)</span><br><span class="line">        &#123;</span><br><span class="line">            ptr1&#x3D;ptr[j++]; &#x2F;&#x2F;入队子节点</span><br><span class="line">            printf(&quot; %c&quot;,ptr1-&gt;Data); </span><br><span class="line">            if(ptr1-&gt;Left!&#x3D;NULL) ptr[i++]&#x3D;ptr1-&gt;Left;</span><br><span class="line">            if(ptr1-&gt;Right!&#x3D;NULL) ptr[i++]&#x3D;ptr1-&gt;Right;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>另外，附上树的实现</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;stdlib.h&gt;</span><br><span class="line"></span><br><span class="line">typedef struct BTree&#123;</span><br><span class="line">    char Elment;</span><br><span class="line">    struct BTree *left;</span><br><span class="line">    struct BTree *right;</span><br><span class="line">&#125;Tree;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">struct BTree *makeTree(char Elm)</span><br><span class="line">&#123;</span><br><span class="line">    Tree *Node &#x3D; (Tree *)malloc(sizeof(struct BTree));</span><br><span class="line">    Node-&gt;Elment &#x3D; Elm;</span><br><span class="line">    Node-&gt;left &#x3D; NULL;</span><br><span class="line">    Node-&gt;right &#x3D; NULL;</span><br><span class="line">    return Node;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">void printTreePre(Tree *Node)</span><br><span class="line">&#123;</span><br><span class="line">    if (Node &#x3D;&#x3D; NULL) &#123;</span><br><span class="line">        return;</span><br><span class="line">    &#125;</span><br><span class="line">    printf(&quot;%c &quot;,Node-&gt;Elment);</span><br><span class="line">    printTreePre(Node-&gt;left);</span><br><span class="line">    printTreePre(Node-&gt;right);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">void printTreeIn(Tree *Node)</span><br><span class="line">&#123;</span><br><span class="line">    if (Node &#x3D;&#x3D; NULL) &#123;</span><br><span class="line">        return;</span><br><span class="line">    &#125;</span><br><span class="line">    printTreeIn(Node-&gt;left);</span><br><span class="line">    printf(&quot;%c &quot;,Node-&gt;Elment);</span><br><span class="line">    printTreeIn(Node-&gt;right);</span><br><span class="line">&#125;</span><br><span class="line">void printTreeB(Tree *Node)</span><br><span class="line">&#123;</span><br><span class="line">    if (Node &#x3D;&#x3D; NULL) &#123;</span><br><span class="line">        return;</span><br><span class="line">    &#125;</span><br><span class="line">    printTreeB(Node-&gt;left);</span><br><span class="line">    printTreeB(Node-&gt;right);</span><br><span class="line">    printf(&quot;%c &quot;,Node-&gt;Elment);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">    struct BTree *root &#x3D; makeTree(&#39;A&#39;);</span><br><span class="line">    root-&gt;left &#x3D; makeTree(&#39;B&#39;);</span><br><span class="line">    root-&gt;right &#x3D; makeTree(&#39;C&#39;);</span><br><span class="line">    root-&gt;left-&gt;left &#x3D; makeTree(&#39;D&#39;);</span><br><span class="line">    root-&gt;left-&gt;right &#x3D; makeTree(&#39;F&#39;);</span><br><span class="line">    root-&gt;left-&gt;right-&gt;left &#x3D; makeTree(&#39;G&#39;);</span><br><span class="line">    root-&gt;left-&gt;right-&gt;right &#x3D; makeTree(&#39;H&#39;);</span><br><span class="line">    root-&gt;left-&gt;right-&gt;left-&gt;left &#x3D; makeTree(&#39;I&#39;);</span><br><span class="line">    root-&gt;left-&gt;right-&gt;left-&gt;right &#x3D; makeTree(&#39;J&#39;);</span><br><span class="line">    printTreePre(root);</span><br><span class="line">    printf(&quot;\n&quot;);</span><br><span class="line">    printTreeIn(root);</span><br><span class="line">    printf(&quot;\n&quot;);</span><br><span class="line">    printTreeB(root);</span><br><span class="line">    return 0;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p><img src="/images/pasted-24.png" alt="upload successful"></p>
<p><img src="/images/pasted-25.png" alt="upload successful"></p>
<p><img src="/images/pasted-26.png" alt="upload successful"></p>
<p><img src="/images/pasted-27.png" alt="upload successful"></p>
<p><strong>哈夫曼树</strong></p>
<p>给定权重分别为1，3，4，6，8的叶子结点，我们应当构建怎样的二叉树，才能保证其带权路径长度最小？</p>
<p>原则上，我们应该让权重小的叶子结点远离树根，权重大的叶子结点靠近树根。</p>
<p>下图左侧的这棵树就是一颗哈夫曼树，它的WPL是46，小于之前例子当中的53：</p>
<p><img src="/images/pasted-28.png" alt="upload successful"></p>
<p>需要注意的是，同样叶子结点所构成的哈夫曼树可能不止一颗，下面这几棵树都是哈夫曼树：</p>
<p><img src="/images/pasted-29.png" alt="upload successful"></p>
<p>假设有6个叶子结点，权重依次是2，3，7，9，18，25，如何构建一颗哈夫曼树，也就是带权路径长度最小的树呢？</p>
<p><img src="/images/pasted-30.png" alt="upload successful"></p>
<p>第一步：构建森林</p>
<p>我们把每一个叶子结点，都当做树一颗独立的树（只有根结点的树），这样就形成了一个森林：</p>
<p><img src="/images/pasted-31.png" alt="upload successful"></p>
<p>在上图当中，右侧是叶子结点的森林，左侧是一个辅助队列，按照权值从小到大存储了所有叶子结点。至于辅助队列的作用，我们后续将会看到。</p>
<p>第二步：选择当前权值最小的两个结点，生成新的父结点</p>
<p>借助辅助队列，我们可以找到权值最小的结点2和3，并根据这两个结点生成一个新的父结点，父节点的权值是这两个结点权值之和：</p>
<p><img src="/images/pasted-32.png" alt="upload successful"></p>
<p>第三步：从队列中移除上一步选择的两个最小结点，把新的父节点加入队列</p>
<p>也就是从队列中删除2和3，插入5，并且仍然保持队列的升序：</p>
<p><img src="/images/pasted-33.png" alt="upload successful"></p>
<p>第四步：选择当前权值最小的两个结点，生成新的父结点。</p>
<p>这是对第二步的重复操作。当前队列中权值最小的结点是5和7，生成新的父结点权值是5+7=12：</p>
<p><img src="/images/pasted-34.png" alt="upload successful"></p>
<p>第五步：从队列中移除上一步选择的两个最小结点，把新的父节点加入队列。</p>
<p>这是对第三步的重复操作，也就是从队列中删除5和7，插入12，并且仍然保持队列的升序：</p>
<p><img src="/images/pasted-35.png" alt="upload successful"></p>
<p>第六步：选择当前权值最小的两个结点，生成新的父结点。</p>
<p>这是对第二步的重复操作。当前队列中权值最小的结点是9和12，生成新的父结点权值是9+12=21：</p>
<p><img src="/images/pasted-36.png" alt="upload successful"></p>
<p>第七步：从队列中移除上一步选择的两个最小结点，把新的父节点加入队列。</p>
<p>这是对第三步的重复操作，也就是从队列中删除9和12，插入21，并且仍然保持队列的升序：</p>
<p><img src="/images/pasted-37.png" alt="upload successful"></p>
<p>第八步：选择当前权值最小的两个结点，生成新的父结点。</p>
<p>这是对第二步的重复操作。当前队列中权值最小的结点是18和21，生成新的父结点权值是18+21=39：</p>
<p><img src="/images/pasted-38.png" alt="upload successful"></p>
<p>第九步：从队列中移除上一步选择的两个最小结点，把新的父节点加入队列。</p>
<p>这是对第三步的重复操作，也就是从队列中删除18和21，插入39，并且仍然保持队列的升序：</p>
<p><img src="/images/pasted-39.png" alt="upload successful"></p>
<p>第十步：选择当前权值最小的两个结点，生成新的父结点。</p>
<p>这是对第二步的重复操作。当前队列中权值最小的结点是25和39，生成新的父结点权值是25+39=64：</p>
<p><img src="/images/pasted-40.png" alt="upload successful"></p>
<p>第十一步：从队列中移除上一步选择的两个最小结点，把新的父节点加入队列</p>
<p>这是对第三步的重复操作，也就是从队列中删除25和39，插入64：</p>
<p><img src="/images/pasted-41.png" alt="upload successful"></p>
<p>此时，队列中仅有一个结点，说明整个森林已经合并成了一颗树，而这棵树就是我们想要的哈夫曼树：</p>
<p><img src="/images/pasted-42.png" alt="upload successful"></p>
<p>时间复杂度:O(nlogn)</p>
<p>好咯，暂时将这样了，再多我也不会了.</p>

        </div>
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91/" rel="tag">哈夫曼树</a>, <a class="has-link-grey -link" href="/tags/%E6%A0%88/" rel="tag">栈</a>, <a class="has-link-grey -link" href="/tags/%E6%A0%91/" rel="tag">树</a>, <a class="has-link-grey -link" href="/tags/%E9%98%9F%E5%88%97/" rel="tag">队列</a>
                </div>
            </div>
        </div>
        
        
        
        <div class="social-share"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">Like this article? Support the author with</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>Alipay</span>
    <div class="qrcode"><img src="https://www.year9.cn/afdian-year9.png" alt="Alipay"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>Wechat</span>
    <div class="qrcode"><img src="https://www.year9.cn/afdian-year9.png" alt="Wechat"></div>
</a>

                
                <!-- Visit https://www.paypal.com/donate/buttons/ to get your donate button -->

<a class="button is-warning donate" onclick="document.getElementById(&#39;paypal-donate-form&#39;).submit()">
    <span class="icon is-small">
        <i class="fab fa-paypal"></i>
    </span>
    <span>Paypal</span>
</a>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" rel="noopener" id="paypal-donate-form">
    <input type="hidden" name="cmd" value="_donations" />
    <input type="hidden" name="business" value="https://www.year9.cn/afdian-year9.png" />
    <input type="hidden" name="currency_code" value="USD" />
</form>

                
                
<a class="button is-danger donate" href="https://www.year9.cn" target="_blank" rel="noopener">
    <span class="icon is-small">
        <i class="fab fa-patreon"></i>
    </span>
    <span>Patreon</span>
</a>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/posts/10153.html">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">晚安系列:聊聊最近的事情吧</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/posts/19129.html">
                <span class="level-item">开发进度：year9.cn完成了后端部分功能</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">Comments</h3>
        
<div id="lv-container" data-id="city" data-uid="MTAyMC80OTIxMC8yNTcwNA==">
    <script type="text/javascript">
        (function(d, s) {
            var j, e = d.getElementsByTagName(s)[0];

            if (typeof LivereTower === 'function') { return; }

            j = d.createElement(s);
            j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
            j.async = true;

            e.parentNode.insertBefore(j, e);
        })(document, 'script');
    </script>
    <noscript> Please activate JavaScript for write a comment in LiveRe</noscript>
</div>

    </div>
</div>
</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left ">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered" style="flex-shrink: 1">
                <div>
                    
                    <figure class="image is-128x128 has-mb-6">
                        <img class="" src="https://q1.qlogo.cn/g?b=qq&amp;nk=12197673&amp;s=640" alt="YEAR9">
                    </figure>
                    
                    <p class="is-size-4 is-block">
                        YEAR9
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        a simple coder for Java &amp; PHP
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>Xiamen Fujian</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Posts
                    </p>
                    <a href="/archives">
                        <p class="title has-text-weight-normal">
                            36
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Categories
                    </p>
                    <a href="/categories">
                        <p class="title has-text-weight-normal">
                            10
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        Tags
                    </p>
                    <a href="/tags">
                        <p class="title has-text-weight-normal">
                            27
                        </p>
                    </a>
                </div>
            </div>
        </nav>
        
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://gitee.com/year9" target="_blank" rel="noopener">
                Follow</a>
        </div>
        
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Gitee" href="https://gitee.com/year9">
                
                <i class="fab fa-github-alt"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Year9&#39;s Homepage" href="https://www.year9.cn">
                
                <i class="fab fa-internet-explorer"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Twitter" href="https://gitee.com/year9">
                
                <i class="fab fa-twitter"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Dribbble" href="https://gitee.com/year9">
                
                <i class="fab fa-dribbble"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="RSS" href="/atom.xml">
                
                <i class="fas fa-rss"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Links
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://www.year9.cn" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">Year9&#39;s Homepage</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.year9.cn</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="http://www.joyhuang.top" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">joyhuang Blog</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.joyhuang.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://blog.dextercai.com" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">DexterCai Blog</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">blog.dextercai.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://vincent-vic.gitee.io" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">Vincent Vic Blog</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">vincent-vic.gitee.io</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>

    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Categories
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/Minecraft/">
            <span class="level-start">
                <span class="level-item">Minecraft</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E5%B7%A5%E4%BD%9C%E7%AC%94%E8%AE%B0/">
            <span class="level-start">
                <span class="level-item">工作笔记</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%88%91%E7%9A%84%E5%BC%80%E5%8F%91%E4%B9%8B%E8%B7%AF/">
            <span class="level-start">
                <span class="level-item">我的开发之路</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">
            <span class="level-start">
                <span class="level-item">数据结构与算法</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">9</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/">
            <span class="level-start">
                <span class="level-item">晚安系列</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E8%BD%AF%E4%BB%B6%E5%8F%91%E5%B8%83/">
            <span class="level-start">
                <span class="level-item">软件发布</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E9%80%9A%E7%9F%A5/">
            <span class="level-start">
                <span class="level-item">通知</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E9%9A%8F%E7%AC%94/">
            <span class="level-start">
                <span class="level-item">随笔</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">9</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Tag Cloud
        </h3>
        <a href="/tags/Flash/" style="font-size: 10px;">Flash</a> <a href="/tags/Linux/" style="font-size: 10px;">Linux</a> <a href="/tags/Vue-js/" style="font-size: 10px;">Vue.js</a> <a href="/tags/%E4%B8%AD%E5%9B%BD%E5%A4%A7%E5%AD%A6Mooc/" style="font-size: 10px;">中国大学Mooc</a> <a href="/tags/%E5%8A%A0%E6%B2%B9/" style="font-size: 15px;">加油</a> <a href="/tags/%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91/" style="font-size: 10px;">哈夫曼树</a> <a href="/tags/%E5%A0%86%E6%A0%88/" style="font-size: 10px;">堆栈</a> <a href="/tags/%E5%AD%A6%E4%B9%A0Vue-js/" style="font-size: 10px;">学习Vue.js</a> <a href="/tags/%E5%BC%80%E5%8F%91%E8%BF%9B%E5%BA%A6/" style="font-size: 10px;">开发进度</a> <a href="/tags/%E6%88%91%E5%A4%AA%E9%9A%BE%E4%BA%86/" style="font-size: 10px;">我太难了</a> <a href="/tags/%E6%8B%AF%E6%95%91007/" style="font-size: 10px;">拯救007</a> <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" style="font-size: 20px;">数据结构</a> <a href="/tags/%E6%96%B0%E5%86%A0%E7%97%85%E6%AF%92/" style="font-size: 10px;">新冠病毒</a> <a href="/tags/%E6%97%85%E6%B8%B8%E8%A7%84%E5%88%92/" style="font-size: 10px;">旅游规划</a> <a href="/tags/%E6%97%A5%E5%BF%97/" style="font-size: 10px;">日志</a> <a href="/tags/%E6%99%9A%E5%AE%89/" style="font-size: 20px;">晚安</a> <a href="/tags/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/" style="font-size: 10px;">晚安系列</a> <a href="/tags/%E6%A0%88/" style="font-size: 10px;">栈</a> <a href="/tags/%E6%A0%91/" style="font-size: 10px;">树</a> <a href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/" style="font-size: 10px;">浏览器</a> <a href="/tags/%E7%AC%A6%E5%8F%B7%E9%85%8D%E5%AF%B9/" style="font-size: 10px;">符号配对</a> <a href="/tags/%E8%B8%A9%E5%9D%91/" style="font-size: 10px;">踩坑</a> <a href="/tags/%E8%BE%9B%E9%85%B8%E5%8E%86%E7%A8%8B/" style="font-size: 10px;">辛酸历程</a> <a href="/tags/%E9%93%BE%E6%A0%88/" style="font-size: 10px;">链栈</a> <a href="/tags/%E9%98%9F%E5%88%97/" style="font-size: 10px;">队列</a> <a href="/tags/%E9%98%9F%E6%A0%88/" style="font-size: 10px;">队栈</a> <a href="/tags/%E9%BB%98%E5%93%80/" style="font-size: 10px;">默哀</a>
    </div>
</div>
    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Recent
        </h3>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-05-12T15:09:00.000Z">2020-05-12</time></div>
                    <a href="/posts/10153.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">晚安系列:聊聊最近的事情吧</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/">晚安系列</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-26T09:58:00.000Z">2020-04-26</time></div>
                    <a href="/posts/31880.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">关于队列、堆栈、树的数据结构总结</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-05T01:47:00.000Z">2020-04-05</time></div>
                    <a href="/posts/19129.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">开发进度：year9.cn完成了后端部分功能</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%88%91%E7%9A%84%E5%BC%80%E5%8F%91%E4%B9%8B%E8%B7%AF/">我的开发之路</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-03T12:11:00.000Z">2020-04-03</time></div>
                    <a href="/posts/17009.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">全国哀悼日4月4日,为抗击疫情的战士们降半旗!</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E9%80%9A%E7%9F%A5/">通知</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-01T09:34:00.000Z">2020-04-01</time></div>
                    <a href="/posts/5527.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">06-图2 Saving James Bond - Easy Version (25分)</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Archives
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">May 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">April 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">March 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">22</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/02/">
                <span class="level-start">
                    <span class="level-item">February 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Tags
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Flash/">
                        <span class="tag">Flash</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Vue-js/">
                        <span class="tag">Vue.js</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%B8%AD%E5%9B%BD%E5%A4%A7%E5%AD%A6Mooc/">
                        <span class="tag">中国大学Mooc</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8A%A0%E6%B2%B9/">
                        <span class="tag">加油</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91/">
                        <span class="tag">哈夫曼树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A0%86%E6%A0%88/">
                        <span class="tag">堆栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%AD%A6%E4%B9%A0Vue-js/">
                        <span class="tag">学习Vue.js</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%BC%80%E5%8F%91%E8%BF%9B%E5%BA%A6/">
                        <span class="tag">开发进度</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%88%91%E5%A4%AA%E9%9A%BE%E4%BA%86/">
                        <span class="tag">我太难了</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%AF%E6%95%91007/">
                        <span class="tag">拯救007</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">
                        <span class="tag">数据结构</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%96%B0%E5%86%A0%E7%97%85%E6%AF%92/">
                        <span class="tag">新冠病毒</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%97%85%E6%B8%B8%E8%A7%84%E5%88%92/">
                        <span class="tag">旅游规划</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%97%A5%E5%BF%97/">
                        <span class="tag">日志</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%99%9A%E5%AE%89/">
                        <span class="tag">晚安</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/">
                        <span class="tag">晚安系列</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%A0%88/">
                        <span class="tag">栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%A0%91/">
                        <span class="tag">树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/">
                        <span class="tag">浏览器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%A6%E5%8F%B7%E9%85%8D%E5%AF%B9/">
                        <span class="tag">符号配对</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%B8%A9%E5%9D%91/">
                        <span class="tag">踩坑</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%BE%9B%E9%85%B8%E5%8E%86%E7%A8%8B/">
                        <span class="tag">辛酸历程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%93%BE%E6%A0%88/">
                        <span class="tag">链栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%98%9F%E5%88%97/">
                        <span class="tag">队列</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%98%9F%E6%A0%88/">
                        <span class="tag">队栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%BB%98%E5%93%80/">
                        <span class="tag">默哀</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        <div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Recent
        </h3>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-05-12T15:09:00.000Z">2020-05-12</time></div>
                    <a href="/posts/10153.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">晚安系列:聊聊最近的事情吧</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/">晚安系列</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-26T09:58:00.000Z">2020-04-26</time></div>
                    <a href="/posts/31880.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">关于队列、堆栈、树的数据结构总结</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-05T01:47:00.000Z">2020-04-05</time></div>
                    <a href="/posts/19129.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">开发进度：year9.cn完成了后端部分功能</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%88%91%E7%9A%84%E5%BC%80%E5%8F%91%E4%B9%8B%E8%B7%AF/">我的开发之路</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-03T12:11:00.000Z">2020-04-03</time></div>
                    <a href="/posts/17009.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">全国哀悼日4月4日,为抗击疫情的战士们降半旗!</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E9%80%9A%E7%9F%A5/">通知</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-04-01T09:34:00.000Z">2020-04-01</time></div>
                    <a href="/posts/5527.html" class="title has-link-black-ter is-size-6 has-text-weight-normal">06-图2 Saving James Bond - Easy Version (25分)</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">数据结构与算法</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Archives
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">May 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">April 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">March 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">22</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/02/">
                <span class="level-start">
                    <span class="level-item">February 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Tags
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Flash/">
                        <span class="tag">Flash</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Vue-js/">
                        <span class="tag">Vue.js</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%B8%AD%E5%9B%BD%E5%A4%A7%E5%AD%A6Mooc/">
                        <span class="tag">中国大学Mooc</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8A%A0%E6%B2%B9/">
                        <span class="tag">加油</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91/">
                        <span class="tag">哈夫曼树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A0%86%E6%A0%88/">
                        <span class="tag">堆栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%AD%A6%E4%B9%A0Vue-js/">
                        <span class="tag">学习Vue.js</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%BC%80%E5%8F%91%E8%BF%9B%E5%BA%A6/">
                        <span class="tag">开发进度</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%88%91%E5%A4%AA%E9%9A%BE%E4%BA%86/">
                        <span class="tag">我太难了</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%AF%E6%95%91007/">
                        <span class="tag">拯救007</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">
                        <span class="tag">数据结构</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%96%B0%E5%86%A0%E7%97%85%E6%AF%92/">
                        <span class="tag">新冠病毒</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%97%85%E6%B8%B8%E8%A7%84%E5%88%92/">
                        <span class="tag">旅游规划</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%97%A5%E5%BF%97/">
                        <span class="tag">日志</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%99%9A%E5%AE%89/">
                        <span class="tag">晚安</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%99%9A%E5%AE%89%E7%B3%BB%E5%88%97/">
                        <span class="tag">晚安系列</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%A0%88/">
                        <span class="tag">栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%A0%91/">
                        <span class="tag">树</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/">
                        <span class="tag">浏览器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%A6%E5%8F%B7%E9%85%8D%E5%AF%B9/">
                        <span class="tag">符号配对</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%B8%A9%E5%9D%91/">
                        <span class="tag">踩坑</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%BE%9B%E9%85%B8%E5%8E%86%E7%A8%8B/">
                        <span class="tag">辛酸历程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%93%BE%E6%A0%88/">
                        <span class="tag">链栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%98%9F%E5%88%97/">
                        <span class="tag">队列</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%98%9F%E6%A0%88/">
                        <span class="tag">队栈</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%BB%98%E5%93%80/">
                        <span class="tag">默哀</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
    
    
</div>

            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    <img src="/images/logo.png" alt="关于队列、堆栈、树的数据结构总结" height="28">
                
                </a>
                <p class="is-size-7">
                &copy; 2020 YEAR9&nbsp;
                Powered by <a href="#" target="_blank" rel="noopener">Hexo</a> & <a
                        href="#" target="_blank" rel="noopener">Icarus</a> Realy thank them.
                        <br>
                         <img src="https://www.year9.cn/static/index/img/beian.png">公安备案:35012402000016 ICP备案:闽ICP备17020129号-3
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/">
                        
                        <i class="fab fa-creative-commons"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/">
                        
                        <i class="fab fa-creative-commons-by"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Download on GitHub" href="https://gitee.com/year9">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("en");</script>


<script>
var IcarusThemeSettings = {
    site: {
        url: 'https://blog.year9.cn',
        external_link: {"enable":true,"exclude":[]}
    },
    article: {
        highlight: {
            clipboard: true,
            fold: 'unfolded'
        }
    }
};
</script>


<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>





<script src="/js/animation.js"></script>



<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="/js/gallery.js" defer></script>



<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>


<a id="back-to-top" title="Back to Top" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>














<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something..." />
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
<script src="/live2d-widget/autoload.js"></script>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
</html>